package com.xxx.seckill.config;

import com.xxx.seckill.pojo.TUser;

/**
 * @Author: xxx
 * @Date: 2023/1/13 19:33
 * @Description: 存储登陆用户
 */
public class UserContext {

    private static ThreadLocal<TUser> userThreadLocal = new ThreadLocal<>();

    public static void setUser(TUser user) {
        userThreadLocal.set(user);
    }

    public static TUser getUser() {
        return userThreadLocal.get();
    }
    

}
